<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head lang="en">
	<meta charset="UTF-8">
	<title>管理员登录</title>
	<link type="text/css" rel="stylesheet" th:href="@{/static/css/pcms-manage/admin_login.css}" href="../../../../static/css/pcms-manage/admin_login.css">
	<style type="text/css">
		.form{background-color:#404040;}
		.form-grp{background-color:#3a3a3a;}
		#embed-captcha{height:210px;}
		#embed-captcha .gt_holder{margin:30px 85px;}
		.float_geetest { display: inline-block;  margin-left: 80px;  margin-top: 20px;}
	</style>
</head>
<body>
<!--错误提示背景色红-->
<p class="error-msg-alt " th:text="${reason}">登录名/密码错误1</p>
<form class="login" th:action="@{/open/geeverify}" th:id="login-form">
	<p class="right-lr-title">
		<span class="line"></span>
		<span class="title">智&nbsp;唐&nbsp;科&nbsp;技&nbsp;管&nbsp;理&nbsp;员&nbsp;统&nbsp;一&nbsp;登&nbsp;录</span>
		<span class="line"></span>
	</p>
	<div class="form">
		<div class="form-grp">
			<input type="text" class="form-ipt" id="nam" name="account"><span class="form-title">用户名</span>
		</div>
		<div class="form-split"></div>
		<div class="form-grp">
			<input type="password" class="form-ipt" id="pwd" name="password"><span class="form-title">密码</span>
		</div>
		<div class="float_geetest" id="float-captcha"></div>
		<p id="wait" class="show float_geetest">正在加载验证码......</p>
		<p id="notice" class="hide">请先拖动验证码到相应位置</p>
	</div>
	<div class="form-btn" onclick="submitF();">登&nbsp;&nbsp;&nbsp;&nbsp;录</div>
</form>
</body>
<script type="text/javascript" th:src="@{/static/js/lib/jquery-1.11.2.min.js}" src="../../../../static/js/lib/jquery-1.11.2.min.js"></script>
<script type="text/javascript" th:src="@{/static/js/common/validate.js}" src="../../../../static/js/common/validate.js"></script>
<script type="text/javascript" th:src="@{/static/js/pcms/admin_login.js}" src="../../../../static/js/pcms/admin_login.js"></script>
<!-- 引入封装了failback的接口--initGeetest -->
<script type="text/javascript" src="http://static.geetest.com/static/tools/gt.js"></script>
<script>
//	window.onload=myfun;
//	function myfun(){
//		location.reload();
//	}
	var handlerEmbed = function (captchaObj) {
		$("#float-submit").click(function (e) {
			var validate = captchaObj.getValidate();
			if (!validate) {
				$("#notice")[0].className = "show";
				setTimeout(function () {
					$("#notice")[0].className = "hide";
				}, 2000);
				e.preventDefault();
			}
		});
		// 将验证码加到id为captcha的元素里，同时会有三个input的值：geetest_challenge, geetest_validate, geetest_seccode
		captchaObj.appendTo("#float-captcha");
		captchaObj.onReady(function () {
			$("#wait")[0].className = "hide";
		});
		// 更多接口参考：http://www.geetest.com/install/sections/idx-client-sdk.html
	};
	$.ajax({
		// 获取id，challenge，success（是否启用failback）
		url: "/open/initcaptcha?t=" + (new Date()).getTime(), // 加随机数防止缓存
		type: "get",
		dataType: "json",
		success: function (data) {
			// 使用initGeetest接口
			// 参数1：配置参数
			// 参数2：回调，回调的第一个参数验证码对象，之后可以使用它做appendTo之类的事件
			initGeetest({
				gt: data.gt,
				challenge: data.challenge,
				product: "float", // 产品形式，包括：float，embed，popup。注意只对PC版验证码有效
				offline: !data.success // 表示用户后台检测极验服务器是否宕机，一般不需要关注
				// 更多配置参数请参见：http://www.geetest.com/install/sections/idx-client-sdk.html#config
			}, handlerEmbed);
		}
	});
</script>
</html>